<?php
	defined( '_JEXEC' ) or die( 'Restricted access' );
	jimport( 'joomla.application.component.controller' );
	
	class HizkimizkiController extends JController
	{
		function display()
		{
			//Get the document
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'languageList', 'ModelHizkimizki' );
			
			//Create the View
			$viewName = JRequest::getVar('view', 'default');
			$viewType = $document->getType();
			$view = &$this->getView($viewName, $viewType);
			
			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}
			
			//Set the layout template and call the view
			$view->setLayout('default');
			$view->display();
		}
		
		function getHiztegi(){
			//Get the document
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'hiztegi', 'ModelHizkimizki' );
			$model->createHiztegi();
			
			//Create the view
			$viewType = $document->getType();
			$view = &$this->getView('hiztegi', $viewType);
			
			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}
			
			//Set the layout template and call the view
			$view->setLayout('default');
			$view->display();
		}

		function adminHizkimizki(){
			//Get the document
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'languageList', 'ModelHizkimizki' );
			
			//Create the View
			$viewName = JRequest::getVar('view', 'default');
			$viewType = $document->getType();
			$view = &$this->getView($viewName, $viewType);
			
			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}
			
			//Set the layout template and call the view
			$view->setLayout('admin');
	        $view->adminHizkimizki();
		}

		function createTranslation(){
			//Get the document
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'languageList', 'ModelHizkimizki' );
			
			//Create the View
			$viewName = JRequest::getVar('view', 'default');
			$viewType = $document->getType();
			$view = &$this->getView($viewName, $viewType);
			
			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}
			
			//Set the layout template and call the view
			$view->setLayout('translations');
			$view->translations();
		}

		function addTranslation(){
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'languageList', 'ModelHizkimizki' );
			
			//Create the View
			$viewName = JRequest::getVar('view', 'msgs');
			$viewType = $document->getType();
			$view = &$this->getView($viewName, $viewType);
			
			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}

			//Set the layout template and call the view
			$view->setLayout('default');
			$view->addTranslation();
		}

		function editTranslation(){
			//Get the document
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'languageList', 'ModelHizkimizki' );
			
			//Create the View
			$viewName = JRequest::getVar('view', 'default');
			$viewType = $document->getType();
			$view = &$this->getView($viewName, $viewType);
			
			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}
			
			//Set the layout template and call the view
			$view->setLayout('edittranslation');
			$view->editTranslation();
		}

		function manageTranslation(){
			//Get the document
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'languageList', 'ModelHizkimizki' );

			$viewName = JRequest::getVar('view', 'msgs');
			$viewType = $document->getType();
			$view = &$this->getView($viewName, $viewType);

			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}

			//Set the layout template and call the view
			$view->setLayout('default');

			$view->manageTranslation();
		}

		function stateTranslation(){
			//Get the document
			$document =&JFactory::getDocument();
			
			//Get the model
			$model = &$this->getModel( 'languageList', 'ModelHizkimizki' );

			$viewName = JRequest::getVar('view', 'msgs');
			$viewType = $document->getType();
			$view = &$this->getView($viewName, $viewType);

			//Set the model in the view
			if (!JError::isError( $model )) {
				$view->setModel( $model, true );
			}

			//Set the layout template and call the view
			$view->setLayout('default');

			$view->stateTranslation();
		}

	}
?>